490b8054ce34f0274ca7b8f7774ed517a9d18a00,src/org/opencms/importexport/CmsImportVersion2.java,CmsImportVersion2,mergePageFile,#String#,698
Before Change
CmsFile pagefile = m_cms.readFile(resname);
// now parse the content of the headerfile to identify the master template used by this
// page
InputStream in = new ByteArrayInputStream(pagefile.getContents());
Document contentXml;
CmsFile bodyfile;
// create DOM document
contentXml = A_CmsXmlContent.getXmlParser().parse(in);
// get the <masterTemplate> node to check the content.
// this node contains the name of the template file
NodeList masterTemplateNode = contentXml.getElementsByTagName("masterTemplate");
// there is only one <masterTemplate> allowed
if (masterTemplateNode.getLength() == 1) {
// get the name of the mastertemplate
mastertemplate = masterTemplateNode.item(0).getFirstChild().getNodeValue();
}
// get the <ELEMENTDEF> nodes to check the content.
// this node contains the information for the body element.
NodeList bodyNode = contentXml.getElementsByTagName("ELEMENTDEF");
// there is only one <ELEMENTDEF> allowed
if (bodyNode.getLength() == 1) {
// get the elementdef
Node bodyElement = bodyNode.item(0);
NodeList nodes = bodyElement.getChildNodes();
int i;
// get the class of the body template
for (i = 0; i < nodes.getLength(); i++) {
if ("CLASS".equals(nodes.item(i).getNodeName())) {
bodyclass = nodes.item(i).getFirstChild().getNodeValue();
break;
}
}
// get the name of the body template
for (i = 0; i < nodes.getLength(); i++) {
if ("TEMPLATE".equals(nodes.item(i).getNodeName())) {
bodyname = nodes.item(i).getFirstChild().getNodeValue();
if (!bodyname.startsWith("/")) {
bodyname = CmsResource.getFolderPath(resname) + bodyname;
}
After Change
// get body template parameters if defined
for (i = 0; i < nodes.size(); i++) {
node = (Node) nodes.get(i);
if ("PARAMETER".equals(node.getName())) {
Element paramElement = (Element) node;
if (bodyparams == null) {